<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>营养分析 - 饮食营养管理系统</title>
    <!-- TailwindCSS CDN -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- FontAwesome CDN -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
    <!-- Vue.js CDN -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body class="bg-gray-50">
    <div id="app" class="min-h-screen flex flex-col">
        <!-- 顶部导航栏 -->
        <nav class="bg-emerald-600 text-white shadow-md">
            <div class="container mx-auto px-4 py-3 flex justify-between items-center">
                <div class="flex items-center space-x-2">
                    <i class="fas fa-leaf text-2xl"></i>
                    <span class="text-xl font-bold">营养师后台管理系统</span>
                </div>
                <div class="flex items-center space-x-4">
                    <a href="#" class="hover:text-emerald-200">
                        <i class="fas fa-bell"></i>
                        <span class="bg-red-500 text-white rounded-full w-5 h-5 text-xs flex items-center justify-center absolute -mt-8 ml-3">3</span>
                    </a>
                    <div class="relative group">
                        <div class="flex items-center space-x-2 cursor-pointer">
                            <img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=150&h=150&q=80" 
                                class="w-8 h-8 rounded-full object-cover" alt="用户头像">
                            <span>管理员</span>
                            <i class="fas fa-chevron-down text-xs"></i>
                        </div>
                        <div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden group-hover:block">
                            <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-emerald-100">
                                <i class="fas fa-user mr-2"></i>个人信息
                            </a>
                            <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-emerald-100">
                                <i class="fas fa-cog mr-2"></i>系统设置
                            </a>
                            <div class="border-t border-gray-200 my-1"></div>
                            <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-emerald-100">
                                <i class="fas fa-sign-out-alt mr-2"></i>退出登录
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </nav>

        <!-- 主要内容区 -->
        <div class="flex flex-1">
            <!-- 侧边导航 -->
            <aside class="bg-white w-64 shadow-md">
                <div class="p-4">
                    <div class="relative">
                        <span class="absolute inset-y-0 left-0 flex items-center pl-3">
                            <i class="fas fa-search text-gray-400"></i>
                        </span>
                        <input type="text" class="pl-10 pr-4 py-2 w-full rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" 
                            placeholder="搜索...">
                    </div>
                </div>
                <nav class="mt-2">
                    <a href="index.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-home mr-3"></i>
                        <span>仪表盘</span>
                    </a>
                    <a href="users.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-users mr-3"></i>
                        <span>用户管理</span>
                    </a>
                    <a href="foods.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-apple-alt mr-3"></i>
                        <span>食物数据库</span>
                    </a>
                    <a href="recipes.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-utensils mr-3"></i>
                        <span>食谱管理</span>
                    </a>
                    <a href="diet-records.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-clipboard-list mr-3"></i>
                        <span>饮食记录</span>
                    </a>
                    <a href="nutrition.html" class="flex items-center px-4 py-3 text-emerald-600 bg-emerald-50 border-l-4 border-emerald-600">
                        <i class="fas fa-chart-pie mr-3"></i>
                        <span>营养分析</span>
                    </a>
                    <a href="settings.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-cog mr-3"></i>
                        <span>系统设置</span>
                    </a>
                </nav>
            </aside>

            <!-- 主内容 -->
            <main class="flex-1 p-6">
                <div class="mb-6 flex justify-between items-center">
                    <div>
                        <h1 class="text-2xl font-bold text-gray-800">营养分析</h1>
                        <p class="text-gray-600">分析用户营养摄入数据、生成营养报告和建议</p>
                    </div>
                    <button class="bg-emerald-600 hover:bg-emerald-700 text-white px-4 py-2 rounded-md flex items-center">
                        <i class="fas fa-file-export mr-2"></i>
                        <span>导出报告</span>
                    </button>
                </div>

                <!-- 筛选和搜索 -->
                <div class="bg-white rounded-lg shadow-md p-4 mb-6">
                    <div class="flex flex-wrap gap-4">
                        <div class="relative flex-grow md:max-w-xs">
                            <select class="pl-3 pr-4 py-2 w-full rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                                <option value="">选择用户</option>
                                <option value="1">张小明</option>
                                <option value="2">李四</option>
                                <option value="3">王五</option>
                                <option value="4">赵六</option>
                                <option value="all">所有用户</option>
                            </select>
                        </div>
                        
                        <div class="flex items-center space-x-4 flex-wrap">
                            <select class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                                <option value="day">日</option>
                                <option value="week" selected>周</option>
                                <option value="month">月</option>
                                <option value="custom">自定义</option>
                            </select>
                            
                            <div class="flex items-center space-x-2">
                                <input type="date" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                                <span>至</span>
                                <input type="date" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                            </div>
                        </div>
                        
                        <button class="bg-emerald-600 hover:bg-emerald-700 text-white px-4 py-2 rounded-md ml-auto">
                            分析
                        </button>
                    </div>
                </div>

                <!-- 营养素分析图表 -->
                <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
                    <!-- 营养素摄入趋势 -->
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <div class="flex items-center justify-between mb-4">
                            <h4 class="text-lg font-medium text-gray-800">热量摄入趋势</h4>
                            <div class="flex items-center space-x-2">
                                <select class="border rounded-md px-2 py-1 text-sm">
                                    <option>过去7天</option>
                                    <option>过去30天</option>
                                    <option>过去90天</option>
                                </select>
                            </div>
                        </div>
                        <div class="h-64 flex items-center justify-center bg-gray-50 rounded">
                            <!-- 图表示意 -->
                            <div class="w-full h-full p-4">
                                <div class="flex h-full items-end justify-around">
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 55%">
                                        <div class="text-xs text-center mt-2">周一</div>
                                    </div>
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 70%">
                                        <div class="text-xs text-center mt-2">周二</div>
                                    </div>
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 85%">
                                        <div class="text-xs text-center mt-2">周三</div>
                                    </div>
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 65%">
                                        <div class="text-xs text-center mt-2">周四</div>
                                    </div>
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 75%">
                                        <div class="text-xs text-center mt-2">周五</div>
                                    </div>
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 60%">
                                        <div class="text-xs text-center mt-2">周六</div>
                                    </div>
                                    <div class="w-8 bg-emerald-500 rounded-t" style="height: 50%">
                                        <div class="text-xs text-center mt-2">周日</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 营养素比例 -->
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <div class="flex items-center justify-between mb-4">
                            <h4 class="text-lg font-medium text-gray-800">营养素比例</h4>
                            <div class="flex items-center space-x-2">
                                <select class="border rounded-md px-2 py-1 text-sm">
                                    <option>本周</option>
                                    <option>本月</option>
                                    <option>全年</option>
                                </select>
                            </div>
                        </div>
                        <div class="h-64 flex items-center justify-center">
                            <!-- 圆形图表示意 -->
                            <div class="relative w-48 h-48">
                                <div class="absolute inset-0 rounded-full border-8 border-blue-500" style="clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0)"></div>
                                <div class="absolute inset-0 rounded-full border-8 border-amber-500" style="clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%)"></div>
                                <div class="absolute inset-0 rounded-full border-8 border-emerald-500" style="clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 50%)"></div>
                                <div class="absolute inset-0 flex items-center justify-center">
                                    <div class="w-36 h-36 rounded-full bg-white"></div>
                                </div>
                            </div>
                            <div class="ml-8 space-y-2">
                                <div class="flex items-center">
                                    <div class="w-4 h-4 bg-emerald-500 rounded-full mr-2"></div>
                                    <span class="text-sm">蛋白质 (25%)</span>
                                </div>
                                <div class="flex items-center">
                                    <div class="w-4 h-4 bg-amber-500 rounded-full mr-2"></div>
                                    <span class="text-sm">脂肪 (30%)</span>
                                </div>
                                <div class="flex items-center">
                                    <div class="w-4 h-4 bg-blue-500 rounded-full mr-2"></div>
                                    <span class="text-sm">碳水化合物 (45%)</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 详细营养素分析和建议 -->
                <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
                    <!-- 营养素详情 -->
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <h4 class="text-lg font-medium text-gray-800 mb-4">营养素详情</h4>
                        <div class="space-y-5">
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">蛋白质</span>
                                    <span class="text-sm font-medium text-gray-700">85g / 90g</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-emerald-600 h-2 rounded-full" style="width: 94%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">脂肪</span>
                                    <span class="text-sm font-medium text-gray-700">68g / 70g</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-amber-500 h-2 rounded-full" style="width: 97%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">碳水化合物</span>
                                    <span class="text-sm font-medium text-gray-700">250g / 280g</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-blue-500 h-2 rounded-full" style="width: 89%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">膳食纤维</span>
                                    <span class="text-sm font-medium text-gray-700">18g / 30g</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-purple-500 h-2 rounded-full" style="width: 60%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">糖</span>
                                    <span class="text-sm font-medium text-gray-700">45g / 50g</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-red-500 h-2 rounded-full" style="width: 90%"></div>
                                </div>
                            </div>
                            <div>
                                <div class="flex justify-between mb-1">
                                    <span class="text-sm font-medium text-gray-700">钠</span>
                                    <span class="text-sm font-medium text-gray-700">1850mg / 2300mg</span>
                                </div>
                                <div class="w-full bg-gray-200 rounded-full h-2">
                                    <div class="bg-orange-500 h-2 rounded-full" style="width: 80%"></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 营养建议 -->
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <h4 class="text-lg font-medium text-gray-800 mb-4">营养建议</h4>
                        <div class="space-y-4">
                            <div class="p-4 bg-emerald-50 rounded-lg flex">
                                <div class="flex-shrink-0 mr-3">
                                    <div class="w-10 h-10 bg-emerald-100 rounded-full flex items-center justify-center">
                                        <i class="fas fa-lightbulb text-emerald-600"></i>
                                    </div>
                                </div>
                                <div>
                                    <h5 class="text-sm font-medium text-emerald-800">增加膳食纤维摄入</h5>
                                    <p class="text-sm text-emerald-700">建议增加蔬菜、水果和全谷物的摄入，提高膳食纤维含量。</p>
                                </div>
                            </div>
                            <div class="p-4 bg-blue-50 rounded-lg flex">
                                <div class="flex-shrink-0 mr-3">
                                    <div class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center">
                                        <i class="fas fa-glass-water text-blue-600"></i>
                                    </div>
                                </div>
                                <div>
                                    <h5 class="text-sm font-medium text-blue-800">增加水分摄入</h5>
                                    <p class="text-sm text-blue-700">每日饮水量建议达到2000ml以上，确保身体充分水合。</p>
                                </div>
                            </div>
                            <div class="p-4 bg-amber-50 rounded-lg flex">
                                <div class="flex-shrink-0 mr-3">
                                    <div class="w-10 h-10 bg-amber-100 rounded-full flex items-center justify-center">
                                        <i class="fas fa-drumstick-bite text-amber-600"></i>
                                    </div>
                                </div>
                                <div>
                                    <h5 class="text-sm font-medium text-amber-800">优化蛋白质来源</h5>
                                    <p class="text-sm text-amber-700">建议增加瘦肉、鱼类和植物蛋白，减少红肉和加工肉类的摄入。</p>
                                </div>
                            </div>
                            <div class="p-4 bg-red-50 rounded-lg flex">
                                <div class="flex-shrink-0 mr-3">
                                    <div class="w-10 h-10 bg-red-100 rounded-full flex items-center justify-center">
                                        <i class="fas fa-triangle-exclamation text-red-600"></i>
                                    </div>
                                </div>
                                <div>
                                    <h5 class="text-sm font-medium text-red-800">注意糖分摄入</h5>
                                    <p class="text-sm text-red-700">建议减少添加糖和含糖饮料的摄入，选择新鲜水果作为甜味来源。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <script>
        const app = Vue.createApp({
            data() {
                return {
                    // 组件数据
                };
            },
            methods: {
                // 组件方法
            }
        });
        
        app.mount('#app');
    </script>
</body>
</html> 